package com.ruoyi.web.controller.system;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.service.SysOrgPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author hnb
 * @Date 2024/11/29
 * @Description
 **/

@RestController
@RequestMapping("/system/person")
public class SysOrgPersonController extends BaseController {

    @Autowired
    private SysOrgPersonService sysOrgPersonService;

    /**
     * 更新ekp人员
     */
    @Log(title = "更新ekp人员编号", businessType = BusinessType.UPDATE)
    @GetMapping("/updateEkpPerson")
    public AjaxResult updateEkpPerson() {
        try {
            sysOrgPersonService.updateEkpPerson();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return AjaxResult.success();
    }

    /**
     * 更新金蝶人员
     */
    @Log(title = "更新金蝶人员", businessType = BusinessType.UPDATE)
    @GetMapping("/updateJdPerson")
    public AjaxResult updateJdPerson() {
        try {
            sysOrgPersonService.updateJdPerson();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return AjaxResult.success();
    }
}
